package org.example.service;


import org.example.dao.BookMapper;
import org.example.model.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
   @Autowired
   private BookMapper bookDao; //依赖注入dao层


    public int addBook(List<Book> book) {
        int i = bookDao.addBook(book);
        return i;
    }

    public Book getId(int id) {
        Book book = bookDao.selectBookById(id);
        return book;
    }

    public int updateBook(Book book) {
        int i = bookDao.updateBook(book);
        return i;
    }
}
